import Vue from 'vue'
import Vant from 'vant';
import 'vant/lib/index.css';

import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import './assets/css/global.css'
// 配置基准
axios.defaults.baseURL = 'https://fanhc.xyz/api/public/v1'
// 移动端适配
import 'amfe-flexible/index.js'
// 头部组件引入
import headnev from '@/components/common/Head.vue'
Vue.use(Vant);
Vue.use(headnev)
Vue.component('head-nev',headnev)

// 筛选器 时间格式
Vue.filter('dateFormat',function(fromVal) {
  const dt = new Date(fromVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2,'0')
  const d = (dt.getDay() + '').padStart(2,'0')
  const hh = (dt.getHours() + '').padStart(2,'0')
  const mm = (dt.getMinutes() + '').padStart(2,'0')
  const ss = (dt.getSeconds() + '').padStart(2,'0')
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})

Vue.config.productionTip = false
Vue.prototype.$http = axios
new Vue({

  components: {
    'head-nev': headnev
  },
  router,
  store,
  render: h => h(App)
}).$mount('#app')
